<template>
  <el-row>
    {{labelText}}
    <!-- 文本输入框 -->
    <el-input v-if="componentType === 'input'" :type="type" :placeholder="placeholder" :value="defaultValue"></el-input>

    <!-- 数字输入框 -->
    <el-input-number v-else-if="componentType === 'number'" :type="type" :placeholder="placeholder" :value="defaultValue"></el-input-number>
  </el-row>
</template>

<script>
export default {
  name: 'MyInput',
  props: {
    componentList: {
      type: Array,
      default: () => []
    },
    componentType: {
      type: String,
      default: "input"
    },
    labelText: {
      type: String,
      default: "输入框"
    },
    placeholder: {
      type: String,
      default: "请输入"
    },
    defaultValue: {
      type: [String, Number],
      default: ""
    },
    type: {
      type: String,
      default: "input"
    }
  },
};
</script>
